package kaikeba.service;

import kaikeba.bean.Courier;
import kaikeba.dao.imp.CourierDaoMysql;

import java.util.Date;
import java.util.List;
import java.util.Map;

public class CourierService {
    static CourierDaoMysql dao = new CourierDaoMysql();
    /**
     * 更新登陆时间与ip
     * @param userPhone
     * @param date
     * @param ip
     */
    public static void updateLoginTimeAndIP(String userPhone, Date date, String ip){
        dao.updateLoginTime(userPhone,date,ip);
    }
    public static Map<String, Integer> console() {
        return dao.console();
    }

    public static List<Courier> findAll(boolean b, int offset, int pageNumber) {

        return dao.findAll(b,offset,pageNumber);
    }

    public static boolean delete(int id) {
        return dao.delete(id);
    }

    public static boolean update(int id, Courier newCourier) {
        return dao.update(id,newCourier);
    }

    public static Courier findByPhone(String userPhone) {
        return dao.findByPhone(userPhone);
    }

    public static boolean insert(Courier c) {
            return dao.insert(c);
    }
}
